#include<iostream>
#include<string>
using namespace std;
string s;
int n;
int main()
{
	cin >> n >> s;
	bool flag = 0;
	for (int i = 0; i < s.size(); i++) {
		if (i + 2 < n) {
			if (s[i] == s[i + 1] && s[i + 1] == s[i + 2] && s[i] == 'x') {
				flag = 1;
				break;
			}
		}
	}
	if (!flag) {
		cout << 0 << endl;
	}
	else {
		int ans = 0;
		for (int i = 0; i < n; i++) {
			if (s[i] == 'x') {
				int j = i + 1;
				int k = 1;
				while (s[j] == 'x') {
					k++;
					j++;
				}
				if (k >= 3) {
					ans += k - 2;
					i += k - 1;
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}